package com.ayoka.ui.course.detail;

import android.os.Bundle;
import android.view.View;

import com.ayoka.R;
import com.ayoka.base.BaseFragment;
import com.ayoka.base.BasePresenter;
import com.ayoka.bean.CourseBean;
import com.ayoka.databinding.FragmentCourseDetailBinding;

/**
 * 首页的Fragment
 * <p>
 * Created by admin on 2017/3/22.
 */

public class CourseDetailFragment extends BaseFragment<FragmentCourseDetailBinding, BasePresenter> {

    public static CourseDetailFragment newInstance(CourseBean courseBean) {
        CourseDetailFragment courseDetailFragment = new CourseDetailFragment();
        Bundle bundle = new Bundle();
        bundle.putSerializable("CourseBean", courseBean);
        courseDetailFragment.setArguments(bundle);
        return courseDetailFragment;
    }

    private CourseBean courseBean;

    @Override
    protected void configBundleArguments() {
        Bundle bundle = getArguments();
        if (bundle != null) {
            courseBean = (CourseBean) bundle.getSerializable("CourseBean");
        }
    }

    @Override
    public int getContentLayout() {
        return R.layout.fragment_course_detail;
    }

    @Override
    protected void initViews(View view) {
    }

    @Override
    public void initData(){
        mDataBinding.tvCourseTitle.setText(courseBean.Title);
        mDataBinding.tvCourseSubTitle.setText(courseBean.SubTitle);
        mDataBinding.tvCourseContent.setText(courseBean.Descp);
    }

    @Override
    protected BasePresenter getPresenter() {
        return null;
    }
}
